PyFig Reader

A PDF reader in which the figures move.

It reads any PDF. A figure that carries its own Python code gets a ▶ button: click it, and the figure plays as an animation, in place on the page.

or drop them anywhere in this window
Open documents
How to use it
  1. 1

    Open

    Open one PDF or several; each gets a tab. Any PDF works. Those without live figures simply read as usual.

  2. 2

    Play at once

    Figures that come with a recorded video start the moment you click them. A figure without one runs its Python code, which takes a few seconds the first time (the top right then says Python: ready).

  3. 3

    Play

    Click ▶ on a figure, and click again to pause. Hover for ⟲, from the start, ■, the printed figure, and </>, its code.

  4. 4

    Go back

    ← Back or Alt+← returns to where you were after a link or a tab switch, and finally here.

Behind the page

An ordinary PDF

A live figure is a normal picture with its script inside the file. Other viewers show the picture, and clicking it opens the animation on the web.

Python, right here

Every figure's code can also run live: press Py on a figure. The reader then starts Python (Pyodide) in this window; the first time, that is a 30 MB download, after that it is ready in about 5 seconds.

Safe to run

Code runs only when you click a figure, in the browser's sandbox. It cannot touch your files, and nothing is uploaded.

For authors: a figure script defines fig and frame(k) and ends with play(…); in LaTeX, \pyfig{name} places it and embeds the script.